Skip to content

[C3] Enable source maps in Worker starter templates - #16195

Draft
irvinebroque wants to merge 3 commits into
mainfrom
bib/source-maps-defaults
Draft

irvinebroque wants to merge 3 commits into
mainfrom
bib/source-maps-defaults

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Enable source maps explicitly in the JavaScript and TypeScript Worker starter templates. Newly generated projects upload maps so production stack traces and profiles resolve to original source. Existing Wrangler, Vite plugin, and autoconfig defaults remain unchanged.

Starter configuration Result
JavaScript and TypeScript Worker templates Explicit upload_source_maps: true in Wrangler configuration
Cloudflare Vite starters (React, Vue, React Router, Waku) Explicit external source maps for Worker/server environments
Explicit upload_source_maps: false C3 preserves the upload opt-out when updating the generated config

Scope Vite source map generation to the starters' Worker/server builds, preserving browser build settings. Keep the C3 config updater's explicit upload opt-out handling. Custom build tools must still emit external maps for Wrangler to upload.

Include a patch changeset for create-cloudflare.

refs https://developers.cloudflare.com/workers/observability/profiling-in-production/ and https://blog.cloudflare.com/workers-on-demand-profiling/

Without this — debugging in production is harder. You don't get stack traces for exceptions that map back to source code. And your production profiles are harder to reason about, since they don't point back to the right line numbers in source code.

Related framework template changes: cloudflare/templates#1166

  • Tests
    • Tests included/updated — one small regression test verifies that C3 preserves an explicit JSON upload opt-out. The full C3 suite passed (307 tests); builds, type checks, changed-code lint, and formatting checks passed.
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation

@changeset-bot

changeset-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15a5098

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-cloudflare Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@16195

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@16195

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@16195

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@16195

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@16195

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@16195

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@16195

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@16195

miniflare

npm i https://pkg.pr.new/miniflare@16195

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@16195

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@16195

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@16195

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@16195

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@16195

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@16195

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@16195

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@16195

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@16195

wrangler

npm i https://pkg.pr.new/wrangler@16195

commit: 15a5098

@irvinebroque irvinebroque changed the title feat: enable Worker source maps by default [C3] Enable source maps in Worker starter templates Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant